<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ include file="/resource/common.jsp"%> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<%--统一用户平台人员管理 --%>
	<title>${title}</title>
	<script type="text/javascript" src="<c:url value='/resource/js/view/resource.js'/>"></script>
	<script type="text/javascript">
		$(function(){
			//界面初始化
			//initView();
			$("#query_form").css({"width":$(window).width()});
			
			$('#test').datagrid({
				//title:'My DataGrid',
				iconCls:'icon-save',
				width:$(window).width(),
				height: $(window).height()-42,
				nowrap: true,
				//autoRowHeight: false,
				striped: true,
				singleSelect:true,
				fitColumns:true,
				onLoadSuccess:function(data){
					$(this).datagrid('doCellTip',{'max-width':'300px','delay':500});
				},
				//collapsible:true,("/os/sys/resource/list/1.html
				url:'<%=path%>/sys/resource/listggo.json',
				//sortName: 'code',
				//sortOrder: 'desc',
				//remoteSort: false,
				idField:'resid',
				frozenColumns:[[
				]],
				columns:[
				  [	
				  	{field:'name',title:'资源名称',width:80,align:'left'},
				  	{field:'url',title:'URL路径',width:166,align:'left'},
			      	{field:'parent_id',title:'资源所属',width:80,align:'left',formatter:function(value,rec){
				  		if(value=='5'){
				  			return "系统管理";
				  		}else if(value=='6'){
				  			return "日志管理";
				  		}
				  		}
			      	},
			      	{field:'remark',title:'备注',width:155,align:'left'},
			      	{field:'resid',title:'',hidden:'true'},
					{field:'opt',title:'操作',width:80,align:'center',fixed:true,
						formatter:function(value,rec){
							return "<span style='color:red'><a href='javascript:uumsResourceEdit("+rec.resid+")'>编辑   </a>"+"<a href='javascript:uumsResourceRemove("+rec.resid+")'>  删除</a>";
						}
					}
				]],
				pagination:true,
				rownumbers:true,
				toolbar:[
					
				]
			});
			var p = $('#test').datagrid('getPager');
			$(p).pagination({
				onBeforeRefresh:function(){
					//alert('before refresh');
				}
			});
			
			
			
			
		});
		function _goto(pageIndex){
			//var _url="<c:url value='/oper/query/@.html'/>".replace("@",pageIndex);
			//$("#query_form").attr("action",_url);
			//$("#query_form").submit();
			
			$('#test').datagrid('load',{
				name:$('#rname').val()
			});
		}
		function onDbclickRow(rowIndex){
			$('#restable').datagrid('selectRow',rowIndex);
			var num = $('#restable').datagrid("getSelected");
		}
		
		
	</script>
</head>
<body >
	<div>
		<div>
	    	<form method="post" id="query_form" action="sys/resource/list/1.html" style="margin:0px;padding:0px;">
<table width="100%" border="0" cellspacing="0" cellpadding="4" style="background:#e9f8ff; border:1px solid #cbd9e4; font-size:14px;">
	    		<tr>
		    		<td class="td_label">名称</td>
		    		<td class="td_text" style="width:200px; ">
		    		<input type="text" id="rname" value="${condition.name}" 
		    		name="name" onblur="this.value=this.value.replace(/[^\w\b\u4e00-\u9fa5]/g,'');"  style="padding-top:3px;width:180px;"/>
		    		</td>
		    		<td class="td_label" style="width:300px;text-align: left;"  >
		    		<a href="javascript:_goto(1);">查询</a>&nbsp;&nbsp;
		    		<a href="javascript:formReset();">重置</a>&nbsp;&nbsp;
		    		<a href="javascript:void(0)" style="width:70px;" onclick="uumsResourceAdd();">新增资源</a></td>
	    		    <td >&nbsp;&nbsp;</td>
	    		</tr>
	    	</table>
	    	</form>
	   	</div>
	   	<div id="tbl_container" style="font-size:12px;">
	   		<table id="test">
	   		
	   		</table>
		</div>
	   	<div style="clear:both;"></div>
	</div>
</body>
</html>
